inspector: Move scrolledwindow into prop list template
authorMatthias Clasen <mclasen@redhat.com>
Sat, 10 May 2014 03:15:34 +0000 (23:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 11 May 2014 02:04:31 +0000 (22:04 -0400)
modules/inspector/prop-list.c
modules/inspector/prop-list.h
modules/inspector/prop-list.ui
modules/inspector/window.ui

index 6c78777ddc4489678f96220a99bf1f6a33aff447..68d507432f3300322d663d189a9738c34558a40a 100644 (file)
@@ -53,9 +53,10 @@ struct _GtkInspectorPropListPrivate
   GtkCellRenderer *value_renderer;
   gboolean child_properties;
   GtkTreeViewColumn *attribute_column;
+  GtkWidget *tree;
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorPropList, gtk_inspector_prop_list, GTK_TYPE_TREE_VIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorPropList, gtk_inspector_prop_list, GTK_TYPE_BOX)
 
 static void
 gtk_inspector_prop_list_init (GtkInspectorPropList *pl)
@@ -143,6 +144,7 @@ gtk_inspector_prop_list_class_init (GtkInspectorPropListClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorPropList, model);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorPropList, value_renderer);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorPropList, attribute_column);
+  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorPropList, tree);
 }
 
 static void
@@ -214,7 +216,7 @@ gtk_inspector_prop_list_prop_changed_cb (GObject              *pspec,
                                          GParamSpec           *prop,
                                          GtkInspectorPropList *pl)
 {
-  GtkTreeIter *iter = g_hash_table_lookup(pl->priv->prop_iters, prop->name);
+  GtkTreeIter *iter = g_hash_table_lookup (pl->priv->prop_iters, prop->name);
 
   if (iter != NULL)
     gtk_inspector_prop_list_update_prop (pl, iter, prop);
index c9dc42caebc4ab89a9aefb30539b9cbdb5c7ef99..6552c4ef6133a7217846fc7c07fad1f7961c2a79 100644 (file)
@@ -38,13 +38,13 @@ typedef struct _GtkInspectorPropListPrivate GtkInspectorPropListPrivate;
 
 typedef struct _GtkInspectorPropList
 {
-  GtkTreeView parent;
+  GtkBox parent;
   GtkInspectorPropListPrivate *priv;
 } GtkInspectorPropList;
 
 typedef struct _GtkInspectorPropListClass
 {
-  GtkTreeViewClass parent;
+  GtkBoxClass parent;
 } GtkInspectorPropListClass;
 
 
index 36c16dcf52631aec49606eb44703af552d7a44bf..d477c754067622a3d49eb7df1593bdc296236804 100644 (file)
       <column type="gchararray"/>
     </columns>
   </object>
-  <template class="GtkInspectorPropList" parent="GtkTreeView">
-    <property name="model">model</property>
-    <property name="tooltip-column">4</property>
+  <template class="GtkInspectorPropList" parent="GtkBox">
+    <property name="orientation">vertical</property>
     <child>
-      <object class="GtkTreeViewColumn">
-        <property name="title" translatable="yes">Property</property>
-        <property name="resizable">True</property>
-        <property name="sort-order">ascending</property>
-        <property name="sort-column-id">0</property>
+      <object class="GtkScrolledWindow">
+        <property name="visible">True</property>
+        <property name="expand">True</property>
+        <property name="hscrollbar-policy">automatic</property>
+        <property name="vscrollbar-policy">always</property>
+        <property name="shadow-type">in</property>
+        <property name="width-request">250</property>
         <child>
-          <object class="GtkCellRendererText">
-            <property name="scale">0.8</property>
+          <object class="GtkTreeView" id="tree">
+            <property name="visible">True</property>
+            <property name="model">model</property>
+            <property name="tooltip-column">4</property>
+            <child>
+              <object class="GtkTreeViewColumn">
+                <property name="title" translatable="yes">Property</property>
+                <property name="resizable">True</property>
+                <property name="sort-order">ascending</property>
+                <property name="sort-column-id">0</property>
+                <child>
+                  <object class="GtkCellRendererText">
+                    <property name="scale">0.8</property>
+                  </object>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                    <attribute name="sensitive">5</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn">
+                <property name="title" translatable="yes">Value</property>
+                <property name="resizable">True</property>
+                <child>
+                  <object class="GtkInspectorPropertyCellRenderer" id="value_renderer">
+                    <property name="scale">0.8</property>
+                    <property name="editable">True</property>
+                    <property name="width-chars">20</property>
+                    <property name="ellipsize">end</property>
+                  </object>
+                  <attributes>
+                    <attribute name="text">1</attribute>
+                    <attribute name="object">3</attribute>
+                    <attribute name="name">0</attribute>
+                    <attribute name="sensitive">5</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="attribute_column">
+                <property name="title" translatable="yes">Attribute</property>
+                <property name="resizable">True</property>
+                <child>
+                  <object class="GtkCellRendererText">
+                    <property name="scale">0.8</property>
+                    <property name="editable">False</property>
+                  </object>
+                  <attributes>
+                    <attribute name="text">6</attribute>
+                    <attribute name="sensitive">5</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn">
+                <property name="title" translatable="yes">Defined At</property>
+                <child>
+                  <object class="GtkCellRendererText">
+                    <property name="scale">0.8</property>
+                  </object>
+                  <attributes>
+                    <attribute name="text">2</attribute>
+                    <attribute name="sensitive">5</attribute>
+                  </attributes>
+                </child>
+              </object>
+            </child>
           </object>
-          <attributes>
-            <attribute name="text">0</attribute>
-            <attribute name="sensitive">5</attribute>
-          </attributes>
-        </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkTreeViewColumn">
-        <property name="title" translatable="yes">Value</property>
-        <property name="resizable">True</property>
-        <child>
-          <object class="GtkInspectorPropertyCellRenderer" id="value_renderer">
-            <property name="scale">0.8</property>
-            <property name="editable">True</property>
-            <property name="width-chars">20</property>
-            <property name="ellipsize">end</property>
-          </object>
-          <attributes>
-            <attribute name="text">1</attribute>
-            <attribute name="object">3</attribute>
-            <attribute name="name">0</attribute>
-            <attribute name="sensitive">5</attribute>
-          </attributes>
-        </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkTreeViewColumn" id="attribute_column">
-        <property name="title" translatable="yes">Attribute</property>
-        <property name="resizable">True</property>
-        <child>
-          <object class="GtkCellRendererText">
-            <property name="scale">0.8</property>
-            <property name="editable">False</property>
-          </object>
-          <attributes>
-            <attribute name="text">6</attribute>
-            <attribute name="sensitive">5</attribute>
-          </attributes>
-        </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkTreeViewColumn">
-        <property name="title" translatable="yes">Defined At</property>
-        <child>
-          <object class="GtkCellRendererText">
-            <property name="scale">0.8</property>
-          </object>
-          <attributes>
-            <attribute name="text">2</attribute>
-            <attribute name="sensitive">5</attribute>
-          </attributes>
         </child>
       </object>
     </child>
index 7ac4ab43a9c275a6de60af79e31010804c8ca265..c9b9a47638ebc5f8740245d19a913c39ec835375 100644 (file)
                     <property name="show-border">False</property>
                     <property name="scrollable">True</property>
                     <child>
-                      <object class="GtkScrolledWindow">
+                      <object class="GtkInspectorPropList" id="prop_list">
                         <property name="visible">True</property>
-                        <property name="hscrollbar-policy">automatic</property>
-                        <property name="vscrollbar-policy">always</property>
-                        <property name="shadow-type">in</property>
-                        <property name="width-request">250</property>
-                        <child>
-                          <object class="GtkInspectorPropList" id="prop_list">
-                            <property name="visible">True</property>
-                            <property name="child-properties">False</property>
-                            <property name="widget-tree">widget_tree</property>
-                          </object>
-                        </child>
+                        <property name="child-properties">False</property>
+                        <property name="widget-tree">widget_tree</property>
                       </object>
                     </child>
                     <child type="tab">
                       </object>
                     </child> 
                     <child>
-                      <object class="GtkScrolledWindow">
+                      <object class="GtkInspectorPropList" id="child_prop_list">
                         <property name="visible">True</property>
-                        <property name="hscrollbar-policy">automatic</property>
-                        <property name="vscrollbar-policy">always</property>
-                        <property name="shadow-type">in</property>
-                        <property name="width-request">250</property>
-                        <child>
-                          <object class="GtkInspectorPropList" id="child_prop_list">
-                            <property name="visible">True</property>
-                            <property name="child-properties">True</property>
-                            <property name="widget-tree">widget_tree</property>
-                          </object>
-                        </child>
+                        <property name="child-properties">True</property>
+                        <property name="widget-tree">widget_tree</property>
                       </object>
                     </child>
                     <child type="tab">